package pl.edu.mimuw.irs.core.util.persistence;

import pl.edu.mimuw.irs.core.model.design.IRSWorkflow;

/**
 * @author Jakub Rauch
 * Created on: 2009-06-29
 */
public class PersistenceAdapter {
	
	// *** Static attributes
	
	private static IPersistenceManager irsWorkflowPersistence;
	private static IPersistenceManager getIrsWorkflowPersistence() {
		if (irsWorkflowPersistence == null) 
			irsWorkflowPersistence = new IRSWorkflowPersistence();
		return irsWorkflowPersistence;
	}

	// *** Static methods
	
	public static IPersistenceManager getManager(Class<?> clazz) {
		if (IRSWorkflow.class.isAssignableFrom(clazz)) {
			return getIrsWorkflowPersistence();
		} else {
			return null;
		}
	}
}
